Generating Security Tokens
When using the Qrvey API in production environments, it is strongly suggested to use a secure JSON Web Token (JWT) for authentication. Include the token in the request header when accessing an endpoint. The Qrvey API supports two types of tokens, depending on which set of endpoints you wish to call:
- Qrvey Admin Center API
- Qrvey Composer API
Generate a Token for the Qrvey Admin Center API
Before generating the token for accessing the Qrvey Admin Center API, obtain your organization’s unique Administrator username and accessKey in the AWS Identify and Access Management (IAM) service. This information was provided in the welcome email when your Qrvey environment was first set up. To create a new Administrator account, see Create a Qrvey Administrator Account in AWS IAM in the Qrvey Partner Portal.
To generate the token:
- Review the Qrvey API documentation for the endpoint Log In To Qrvey Admin Center().
- Call the endpoint, passing the
username
andaccessKey
values. - In the response, parse out the
token
value and save it for all future Qrvey Admin Center API calls.
Generate a Token for the Qrvey Composer API
Before generating the token for accessing the Qrvey Composer API, obtain the following three values that are unique to your instance of the Qrvey platform:
x-api-key
. Your organization's unique and private API key. The API key was provided to your organization by Qrvey when your Qrvey environment was created. This information should never be exposed to external users.appId
. System-defined ID of the Qrvey application.userId
. System-defined ID of the Qrvey Composer user that owns the Qrvey application.
For information on obtaining these values, see Frequently Asked Questions.
To generate the token:
- Review the Qrvey API documentation for the endpoint Generate Token (for Creators).
- Call the endpoint, passing your organizations unique
appId
,userId
, andx-api-key
values. - In the response, parse out the
token
value and save it for all future Qrvey Composer API calls.
For Additional Information
- If you intend to use the JWT token to embed a Qrvey widget, see the additional details in Embedding Widgets Using a Security Token.
- For a video tutorial on embedding Qrvey widgets using JWT tokens, see JWT Widget Integration.